<script>
  export default {
    onLaunch: function() {
      // #ifdef MP-WEIXIN
      // 监听路由切换
      wx.onAppRoute(function(res) {
        let pages = getCurrentPages()
        let view = pages[pages.length - 1]
        if (view) {
          wx.showShareMenu({
            withShareTicket: true,
            menus: ['shareAppMessage', 'shareTimeline']
          })
        }
      })
      // #endif

      if (uni.getStorageSync('userInfo')) {
        // 如果有用户信息的话直接跳转到首页
      } else {
        // 如果没有用户信息的话
        if (this.$storageSync('isToken', null) != 1) {
          // uni.reLaunch({
          //   url: '/pagesB/login'
          // })
        }
      }
      // uni.setStorageSync('userInfo', {
      //   nickName: '你瞅啥'
      // });
    },
    onShow: function() {

    },
    onHide: function() {
      console.log('App Hide')
    },
  }
</script>

<style lang="scss">
  /*每个页面公共css */
  @import "colorui/main.css";
  @import "colorui/icon.css";
  @import "colorui/animation.css";
  @import "uview-ui/index.scss";
  @import "static/index.less"
</style>